Public Function GetWizardInfo(Names As Variant) As Long
ReDim Names(NUM_WIZARDS)
GetWizardInfo = NUM_WIZARDS
End Function
'Enumerate the names and values of a specified property
Public Function GetEnumNames(ByVal PropID As Long, Names As Variant, Values As Variant) As Long
GetEnumNames = 0
End Function
Public Function PageControls(ByVal ThisRegenMethod As Object, ByVal Graphic As Object, ByVal PageNumber As Long, ByVal SaveProperties As Boolean) As Boolean
'Set up error function
On Error GoTo Failed
Dim Diameter#, Length#, LengthThread#
Dim SSolid%
If SaveProperties Then
'OK button on property page was clicked
'Form is still loaded
With frmBolt3D
'Need On Error statement for the case where you have
'RRect Turbo Shape and ahother "shape" selected
On Error Resume Next
'When the property page is closed, transfer the numeric
'Diameter value from the TextBox to the Graphic
'Get the value as a double-precision number
Diameter# = CDbl(.txtdd.Text)
Length# = CDbl(.txtLen.Text)
LengthThread# = CDbl(.txtThread.Text)
TypeB = .List1.Text
If .Surf_Solid.Value = True Then ' if surface
SSolid = 0
ElseIf .Surf_Solid1.Value = True Then
SSolid = 1
End If
'Make sure it's between 0 and 100
If Diameter# < 0# Then Diameter# = 1#
If LengthThread > Length Then LengthThread = Length
If grfThis.Properties("Selected") = False Or SSolid <> SolidOld Or Abs(L - LenProp) > Eps Or Abs(L - LOld) > Eps Or Abs(dd - ddOld) > Eps Or Abs(lThread - LThreadOld) > Eps Or TypeBb <> TypeBOld Then
L = LenProp
grfThis.Graphics.Clear gfCosmetic
' Block for Scaling
Dim AddScale#
AddScale = 1
dd = dd * AddScale
L = L * AddScale
lThread = lThread * AddScale
If TypeBb = "HexBolt" Then Call HexBolt(grfThis, dd, L, Salp, Calp, lThread, SSolid)
If TypeBb = "SlottedBolt" Then Call SlottedBolt(grfThis, dd, L, Salp, Calp, lThread, SSolid)
If TypeBb = "HexFlScrew" Then Call HexFlScrew(grfThis, dd, L, Salp, Calp, lThread, SSolid)
' Block for Unscaling
dd = dd / AddScale
L = L / AddScale
lThread = lThread / AddScale
grfThis.Properties("DiameterOld") = dd
grfThis.Properties("LengthOld") = L
grfThis.Properties("LengthThreadOld") = lThread
grfThis.Properties("DiameterOld") = dd
grfThis.Properties("BTypeOld") = TypeBb
grfThis.Properties("BoltSolidOld") = SSolid
End If
End If
grfThis.RegenUnlock
Exit Function
FailedLock:
'Remove lock
grfThis.RegenUnlock
Failed:
End Function
Public Function Draw(ByVal grfThis As Object, ByVal view As Object, Optional mat As Variant) As Boolean
'Return True if we did the redraw (no further processing necessary, no children will be drawn).
'Since this is just a test, we return False to let TurboCAD do the drawing operation.
Draw = False
End Function
Private Function Angle(sinb As Double, cosb As Double) As Double
If Abs(cosb) < 0.0001 Then
If sinb > 0 Then
Angle = Pi / 2
Else
Angle = 3 * Pi / 2
End If
Else
If sinb >= 0 And cosb > 0 Then Angle = Atn(sinb / cosb)
If sinb >= 0 And cosb < 0 Then Angle = Pi + Atn(sinb / cosb)
If sinb < 0 And cosb < 0 Then Angle = Pi + Atn(sinb / cosb)
If sinb < 0 And cosb > 0 Then Angle = 2 * Pi + Atn(sinb / cosb)
End If
End Function
' HexBolt
Private Sub HexBolt(Gr As Graphic, dd As Double, L As Double, Salp As Double, Calp As Double, lThread As Double, SSolid As Integer)